package easy;

public class Solution_1909 {

    public boolean canBeIncreasing(int[] nums) {
        int index = -1;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] <= nums[i - 1]) {
                return check(nums, i) || check(nums, i - 1);
            }
        }
        return true;
    }

    public boolean check(int[] nums, int removeIndex) {
        int pre = -1;
        for (int i = 0; i < nums.length; i++) {
            if (i != removeIndex) {
                if (pre >= 0 && nums[i] <= nums[pre]) {
                    return false;
                }
                pre = i;
            }
        }
        return true;
    }
}
